{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="ibox float-e-margins">
        <div class="ibox-content">
            <div class="row">
                <!--搜索框开始-->
                <div class="col-sm-12">
                    <div class="layui-form layui-form-item">

                        <div class="layui-input-inline" style="margin-top: 10px;">
                            <label >收货人：</label>
                            <input type="text" class="layui-input" value="{$order.addr_user_name}" disabled />
                        </div>

                        <div class="layui-input-inline" style="margin-top: 10px;">
                            <label >收货人手机号：</label>
                            <input type="text" class="layui-input" value="{$order.addr_user_phone}" disabled />
                        </div>

                        <div class="layui-input-inline" style="margin-top: 10px;">
                            <label >订单商品数量：</label>
                            <input type="text" class="layui-input" value="{$order.bo_total_number}" disabled />
                        </div>

                        <div class="layui-input-inline" style="margin-top: 10px;">
                            <label >订单总价：</label>
                            <input type="text" class="layui-input" value="{$order.bo_total_price}" disabled />
                        </div>

                    </div>
                </div>
                <!--搜索框结束-->

                <!--操作框开始-->
                <div class="col-sm-12">

                    <div class="layui-input-inline">
                        <label >收货地址：</label>
                        <input type="text" class="layui-input" style="width: 700px" value="{$order.sheng}{$order.shi}{$order.qu}{$order.addr_address}" disabled />
                    </div>

                </div>
                <!--操作框结束-->
            </div>
            <div class="hr-line-dashed"></div>

            <div class="example-wrap">
                <div class="example">
                    <table class="layui-hide" id="test" lay-filter="testReload"></table>

                    <script type="text/html" id="typeBar">
                        {{# if(d.bg_type == 1){ }}
                        <span style="color: red">花样青青</span>
                        {{# } }}
                        {{# if(d.bg_type == 2){ }}
                        <span style="color: green">脖脸皮</span>
                        {{# } }}
                    </script>

                    <!--图片模板-->
                    <script type="text/html" id="imgTpl">
                        <img src="{{d.bg_thumb}}" style="width: 20px;height: 20px;cursor: pointer;object-fit: cover;" class="img-circle table-img" onerror="this.src='/static/admin/images/head_default.gif'"/>
                    </script>

                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
<script>
    //layui渲染数据表格
    layui.use('table', function () {
        var table = layui.table
                , form = layui.form;
        table.render({
            elem: '#test'
            , url: '{:url("Orderb/orderGoods")}'
            ,response: {
                statusCode: 220 //成功的状态码，默认：0
            }
            , page: true
            , size: 'sm' //sm小尺寸的表格 lg大尺寸
            , cellMinWidth: 150
            , limits: [5, 10, 15, 20, 25, 30]
            , limit: "{:config('pages')}"
            , loading: true
            , id: 'testReload'
            , cols: [[
//                {type: 'checkbox', fixed: 'left',}
                {type:'numbers', width: 60, title: '序号'}
                , {field: 'bg_name', width: '', title: '商品', align: 'center'}
                , {field: 'boi_goods_number', width: 120, title: '数量', align: 'center'}
                , {field: 'bg_type', width: 120, title: '类型', align: 'center', toolbar: '#typeBar'}
                , {field: 'bg_thumb', width: 120, title: '缩略图', align: 'center', templet: '#imgTpl'}
                , {field: 'bg_spec', width: 140, title: '规格', align: 'center'}
                , {field: 'bg_price', width: 140, title: '单价', align: 'center'}
                , {field: '', width: 100, title: '', align: 'center'}
                , {field: '', width: 100, title: '', align: 'center'}
                // , {field: 'boi_goods_price', width: '', title: '总价', align: 'center'}
//                , {fixed: 'right', width: 250, title: '操作', align: 'center', toolbar: '#opeBar'}
            ]]
            ,done: function (res, curr, count) {
                $('.img-circle').viewer({
                    url: 'data-original',
                });
            }
        });

        //监听单元格编辑---排序
        table.on('edit(testReload)', function(obj){
            var value = obj.value //得到修改后的值
                    ,data = obj.data //得到所在行所有键值
                    ,field = obj.field; //得到字段
            wk.change(data.banner_id,"{:url('updateSort')}",field,value);
        });

        $('.layuiBtn').on('click', function () {
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
        });
        var getIds = function () {
            var ids = [];
            var checkStatus = table.checkStatus('testReload')
                    ,data = checkStatus.data;
            $.each(data,function(index,item){
                ids.push(item['banner_id'])
            });
            return ids;
        }
    });
</script>
</body>
</html>